﻿namespace Raven
{
    public class FzVery : FuzzyTerm
    {
        private FuzzySet _set;

        public FzVery(FzSet ft)
        {
            _set = ft.set;
        }

        public FzVery(FuzzySet set)
        {
            _set = set;
        }

        public FuzzyTerm Clone()
        {
            return new FzVery(_set);
        }

        public Fix GetDOM()
        {
            return _set.GetDOM() * _set.GetDOM();
        }

        public void ClearDOM()
        {
            _set.ClearDOM();
        }

        public void ORwithDOM(Fix val)
        {
            _set.ORwithDOM(val * val);
        }
    }

    public class FzFairly : FuzzyTerm
    {
        private FuzzySet _set;

        public FzFairly(FzSet ft)
        {
            _set = ft.set;
        }

        public FzFairly(FuzzySet set)
        {
            _set = set;
        }

        public FuzzyTerm Clone()
        {
            return new FzFairly(_set);
        }

        public Fix GetDOM()
        {
            return FixMath.Sqrt(_set.GetDOM());
        }

        public void ClearDOM()
        {
            _set.ClearDOM();
        }

        public void ORwithDOM(Fix val)
        {
            _set.ORwithDOM(FixMath.Sqrt(val));
        }
    }
}